#ifndef STATISTIQUES_H
#define STATISTIQUES_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QVariant>
#include <QStringList>
#include <QList>
#include <QMap>

class Statistiques : public QObject
{
    Q_OBJECT
public:

    enum TYPE
    {
        QUANTITE, SOMME
    };

    explicit Statistiques(QObject *parent = 0, QSqlDatabase database = QSqlDatabase::database());

    //Stats de base


    static QStringList consoMax(int id = 0);
    static QStringList consoMax(QString recherche = QString() ,int id = 0);

    //Stats modules

    static int dernieresConsos(QList<int> * pgs, QList<QStringList *> *Consos, int limite = 6);

    static int grosConsommateurs(QList<int> *pgs, QList<double> *somme, TYPE type = SOMME, int limite = 3);
    
signals:
    
public slots:

private:
    QSqlDatabase db;


};

#endif // STATISTIQUES_H
